package file;

import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2023-10-02
 * Time: 11:07
 */
//文件的删除
public class Demo3 {
    public static void main(String[] args) throws IOException, InterruptedException {
        File file=new File("./abc.txt");
        file.createNewFile();

        System.out.println(file.delete());

        File file1=new File("./def.txt");
        file1.createNewFile();
        Thread.sleep(5000);
        file1.deleteOnExit();

    }
}
